home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 December
/
PCWorld_2007-12_cd.bin
/
domacnost a kancelar
/
autoit
/
autoit-v3-setup.exe
/
Examples
/
Helpfile
/
RunAsSet.au3
< prev
next >
Wrap
Text File
|
2007-09-08
|
502b
|
14 lines
; This example will rerun itself with admin rights on using a local account
; Note on Vista this may not work as even though the user is admin it may
; not be elevated even after the RunAs call. In that case use #RequireAdmin
; at the top of the script.
; Are we already admin?
If Not IsAdmin() Then
RunAsSet('USER', @Computername, 'PASSWORD')
Run('"' & @AutoItExe & '"' & ' "' & @ScriptFullPath & '"', @WorkingDir)
Exit
EndIf
MsgBox(0, 'Message', 'Now running with admin rights.')